package zee.com.customviewexample.activity

import android.support.v4.app.Fragment
import com.zee.log.ZLog

import com.zee.adapter.ZxBottomBarAdapter
import kotlinx.android.synthetic.main.activity_main_fragment.*

import zee.com.customviewexample.R
import zee.com.customviewexample.fragment.FirstFragment
import zee.com.customviewexample.fragment.SecondFragment

class ZxBottomBarLayoutActivity : BaseActivity() {

    override fun getLayoutID(): Int {
        return R.layout.activity_main_fragment
    }

    override fun initViews() {
        val loZFragmentUtils = object : ZxBottomBarAdapter(this) {

            override fun containerViewId(): Int {
                return R.id.id_fragment_root
            }

            override fun getFragment(viewID: Int): Fragment? {
                when (viewID) {
                    R.id.id_fragment_1 -> {
                        ZLog.i("选择第一个")
                        return FirstFragment()
                    }
                    R.id.id_fragment_2 -> {
                        ZLog.i("选择第二个")
                        return SecondFragment()
                    }
                    else -> return null
                }
            }
        }


        layout_bottom_bar.setZxBottomBarAdapter(loZFragmentUtils)
    }
}
